<template>
    <div>
        <el-form ref="form" :model="form" label-width="200px" style="width: 500px" >
            <el-form-item label="工程名称">
            <el-input v-model="form.name"></el-input>

          <!-- </el-form-item>
          <el-form-item label="荷载设计值折减系数">
            <el-select v-model="form.region" placeholder="请选择类型">
              <el-option label="0.95" value="0.95"></el-option>   
              <el-option label="1.0" value="1.0"></el-option>        
            </el-select>
            
          </el-form-item> -->
            
         
            
          </el-form-item>


        <h1 align="center">基本参数</h1>

          <el-form :label-position="labelPosition" label-width="400px" :model="formLabelAlign" >
            <el-form-item label="简支梁长L(m)" style="width: 500px"  >
                <el-input v-model="form.l"></el-input>
            </el-form-item>
            <el-form-item label="简支梁间距/受荷面宽B(m)" style="width: 500px">
                <el-input v-model="form.b"></el-input>
            </el-form-item>
            <el-form-item label="恒载标准值Gk(kN/m2)" style="width: 500px">
                <el-input v-model="form.gk"></el-input>
            </el-form-item>
            <el-form-item label="活载标准值Qk(kN/m2)" style="width: 500px">
                <el-input v-model="form.qk"></el-input>
            </el-form-item>
            <el-form-item label="恒载分项系数γG" style="width: 500px">
                <el-input v-model="form.r1"></el-input>
            </el-form-item>
            <el-form-item label="//活载分项系数γQ" style="width: 500px">
                <el-input v-model="form.r2"></el-input>
            </el-form-item>
            <el-form-item label="//X轴塑性发展系数γx" style="width: 500px">
                <el-input v-model="form.rs"></el-input>
            </el-form-item>

            <h1 align="center">梁截面参数</h1>
            <el-form-item label="截面面积A(cm2)" style="width: 500px">
                <el-input v-model="form.a"></el-input>
            </el-form-item>
            <el-form-item label="截面惯性矩Ix(cm4)" style="width: 500px">
                <el-input v-model="form.i"></el-input>
            </el-form-item>
            <el-form-item label="截面抵抗矩Wx(cm3)" style="width: 500px">
                <el-input v-model="form.wx"></el-input>
            </el-form-item>
            <el-form-item label="自重标准值gk(kN/m)" style="width: 500px">
                <el-input v-model="form.g"></el-input>
            </el-form-item>
            <el-form-item label="抗弯强度设计值[f](N/mm2)" style="width: 500px">
                <el-input v-model="form.f"></el-input>
            </el-form-item>
            <el-form-item label="抗剪强度设计值τ(N/mm2)" style="width: 500px">
                <el-input v-model="form.t"></el-input>
            </el-form-item>
            <el-form-item label="弹性模量E(N/mm2)" style="width: 500px">
                <el-input v-model="form.e"></el-input>
            </el-form-item>





            <!-- <el-form-item label="面板抗弯强度设计值[f](N/mm2)" style="width: 500px">
            <el-input
              placeholder="205"
              v-model="input"
              :disabled="true">
            </el-input>
            </el-form-item> -->

            

            
  

        </el-form>
            <el-form-item>
            <el-button type="primary" @click="onSubmit">立即计算</el-button>
            <el-button type="default"  @click="exit">清空</el-button>
            </el-form-item> 
        </el-form>  



      <!-- <h3>面板长向接缝方式为端缝齐平，根据《组合钢模板技术规范》GB/T50214-2013，4.3.5和4.4.5条，面板强度及挠度验算，宜以单块面板作验算对象。面板受力简图如下：
          </h3>
          <h3> 1、强度验算</h3>
             <h3>q＝bS承＝{{form.region}}*{{form.b}}×{{form.s}}={{form.q}}kN/m</h3> -->
           <h2 v-if="form.v>0" align="center"> 承载能力极限状态：<br>
                q=γG(Gk×B+gk)+γQ×Qk×B={{form.r1}}×({{form.gk}}×{{form.b}}+{{form.g}})+{{form.r2}}×{{form.qk}}×{{form.b}}={{form.q1}}kN/m <br>
                正常使用极限状态：<br>
                q'= Gk×B+gk+Qk×B={{form.gk}}×{{form.b}}+{{form.g}}+{{form.qk}}×{{form.b}}={{form.q2}}kN/m<br>


                1、抗弯验算<br>
                Mmax=qL2次方/8={{form.q1}}*{{form.l}}的2次方/8={{form.m}} kN·m<br>
                σ= Mmax /(γxW)={{form.m}}×10的6次方/({{form.rs}}×{{form.wx}}×10的3次方)={{form.m1}}N/mm2  <br>
                
                
                2、挠度验算<br>
                νmax=5/384×(q'×L4)/(E×Ix) =5/384×({{form.q2}}×{{form.l}}的4次方)/({{form.e}}*{{form.i}})={{form.v}}mm   <br>
                
                </h2>

    </div>

   

    
</template>










  <script>
    import gc from '@/api/gongcheng'
    export default {
      data() {
        return {
          form: {            
            l:'',
            b:'',
            gk:'',
            qk:'',
            r1:'',
            r2:'',
            rs:'',
            a:'',
            i:'',
            wx:'',
            g:'',
            f:'',
            t:'',
            e:'',  
            q1:'', 
            m:'', 
            m1:'',
            v:''                
          },
          input: ''
        }
      },
      created(){
        
          

      },


      methods: {
        onSubmit() {
          gc.getJZL(this.form)
              .then(response => {//计算成功
                // console.log(response.data.ql.e)
                // console.log(this.form.e)
                this.form.q1 =response.data.ql.q1
                this.form.q2 =response.data.ql.q2
                this.form.m =response.data.ql.m
                this.form.m1 =response.data.ql.m1
                this.form.v =response.data.ql.v
                console.log(this.form.q1)
                console.log(this.form.m1)
                console.log(this.form.v)
                //提示信息
                this.$message({
                  type: 'success',
                  message: '计算成功!'
                }); 
                //回到列表页面 路由跳转
                //  this.$router.push({path:'/gongcheng/tufang'})

            })
          },
          exit(){
            
            this.form={
              v:0
            }
        },
      
    }
        
    }
  
  </script>